#include <iostream>
using namespace std;

class B
{
public:
    B()
        {
            cout<<"default constructor"<<endl;
        }
    ~B()
        {
            cout<<"destructed " << data << endl;
        }
    B(int i):data(i)
        {
            cout<<"constructed by parameter " << data <<endl;
        }

    int data;
};


B Play( B b)
{
    return b ;
}

#if 1

int main(int argc, char* argv[])
{ 
    B t1 = Play(5);
    t1.data = 7;
    cout << "=== " << __FUNCTION__ << " " << __LINE__ << " " << __FILE__ << " ===" << endl;
    B t2 = Play(t1);
    cout << "=== " << __FUNCTION__ << " " << __LINE__ << " " << __FILE__ << " ===" << endl;
    t1.data = 8;
    t2.data = 9;
    
    return 0;
} 

#else

int main(int argc, char* argv[])
{ 
    B t1 = Play(5);
    B t2 = Play(10);
    return 0;
} 

#endif

